<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        body,html{
            width: 100%;
            height: 100%;
            /*display: block;*/
        }
        img{
            width: 100%;
            /*height: 100%;*/
            display: block;
        }
        .copy{
            position: fixed;
            width: 100%;
            height: 30%;
            top:20%;
        }
        .copy-wrap{
            opacity: 0;
            position: fixed;
            top:0;
        }
    </style>
    <title>拉新奖励活动</title>
</head>
<body>
<img src="https://antfresh.oss-cn-hangzhou.aliyuncs.com/m/shiliu/pullnew.png" alt="">
<div class="copy-wrap">
    <text  class="WeChat-num" >myyouxuan16</text>
    <div class="copy" onclick="" data-clipboard-action="copy" data-clipboard-target="div">复制</div>
</div>
<script src="https://cdn.bootcss.com/clipboard.js/1.6.1/clipboard.js"></script>
<script>
    var clipboard = new Clipboard('.copy',{
        target: function() {
            return document.querySelector('.WeChat-num');
        }
    });
    clipboard.on('success', function(e) {
        alert('复制成功')
    });

    clipboard.on('error', function(e) {
        alert('复制失败')
    });

</script>
</body>
</html>
